import {myRequest} from '@/util/api.js'
import common from '@/util/util'
// 显示资产的接口方法
  // basicUrl:基准路由
  // type：什么提交类型
  // resource：传入的资源
  // params：正常的参数
  // 后拼接的路由
  //列表
export function merchantList(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/merchantList'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
    data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}
export function addOrder(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/addOrder'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
     data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}
export function cargoTypeList(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/cargoTypeList'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
     data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}
export function cargoTemplateList(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/cargoTemplateList'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
     data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}

//用户订单列表
export function wxOrderList(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/wxOrderList'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
     data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}

// 取消订单
export function cancelOrder(params, type, resource, secondUrl) {
  const basicUrl = '/wx/biz/cancelOrder'
  return myRequest({
    url: common.getUrl(basicUrl, resource, secondUrl),
    method: type,
     data: ['put', 'post','get', 'delete'].indexOf(type) >= 0 ? params : null,
  })
}
